package com.ll.base.dto;

import com.ll.base.util.ScalarUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class PageReqDTO {
    @ApiModelProperty(value = "当前页，默认1", example = "1")
    private Integer pageNo;

    @ApiModelProperty(value = "每页行数，默认10", example = "10")
    private Integer pageSize;

    public void initPage(){
        if(ScalarUtil.isEmpty(this.pageNo)){
            this.pageNo = 1;
        }

        if(ScalarUtil.isEmpty(this.pageSize)){
            this.pageSize = 10;
        }
    }


    public void initPage(Integer pageNo, Integer pageSize){
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }
}